# -*- encoding: utf-8 -*-
"""
The default plugins :
    Default control
    Default panels
"""
import os, sys

from setuptools import setup

__author__ = "Szentandrasi Istvan"
LANGUAGES = ('hu','zh_CN', 'es', 'oc', 'tr', 'fr', 'ca')
DOMAIN = 'defaults'
BASEDIR = 'defaults'+os.path.sep


if __name__ == "__main__":
    os.chdir(os.path.dirname(os.path.abspath(__file__)))
    #generate templates
    if '--gen_templates' in sys.argv:
        os.system("pygettext.py -d %s -p %s %s" %
                (DOMAIN, BASEDIR+"po", "defaults/*.py" )
                )
        sys.argv.remove('--gen_templates')


    # Create mo files:
    if not os.path.exists(BASEDIR+"locale"):
            os.mkdir(BASEDIR+"locale/")
    for lang in LANGUAGES:
            pofile = BASEDIR+"po/" + lang + ".po"
            mofile = BASEDIR +"locale/"+ lang + "/defaults.mo"
            if not os.path.exists(BASEDIR+"locale/" + lang + "/"):
                    os.mkdir(BASEDIR+"locale/" + lang + "/")
            print "generating", mofile
            os.system("msgfmt %s -o %s" % (pofile, mofile))

setup(
        name = "Default Pack",
        version = "0.1",
        description = __doc__,
        author = __author__,
        packages = ['defaults'],
        package_data = {'defaults': ['coll_type/*.svg', 'locale/*/*.mo','img/*.svg']},
        include_package_data = True,
        entry_points = '''
        [etude.layouts]
        DefaultLayout = defaults.layout:DefaultLayout

        [etude.panels]
        DefaultPlaylist = defaults.playlist:DefaultPlaylist
        DefaultEqualizer = defaults.equalizer:DefaultEqualizer
        DefaultMedialib = defaults.medialib:MediaLib
        DefaultCollections = defaults.collections:Collections
        DefaultSongInfo = defaults.songinfo:SongInfo
        DefaultFileBrowser = defaults.filebrowser:DefaultFileBrowser

        [etude.extra]
        DefaultNotify = defaults.notify:DefaultNotify
        DefaultStatusIcon = defaults.status:DefaultStatusIcon
        '''
        )



